<?php

use think\migration\Seeder;

class AdminUser extends Seeder
{
    /**
     * Run Method.
     *
     * Write your database seeder using this method.
     *
     * More information on writing seeders is available here:
     * http://docs.phinx.org/en/latest/seeding.html
     */
    public function run()
    {
      $faker = Faker\Factory::create('zh_CN');

      $data = [];
      $data[] = [
                'username'      => 'admin',
                'password'      => md5('111111'),
                'nickname'      => $faker->name,
                'email'         => $faker->email,
                'role'          => '["1"]',
                'create_at'     => date('Y-m-d H:i:s'),
                'update_at'     => date('Y-m-d H:i:s'),
            ];


      $table = $this->table('admin_user');

      $table->insert($data)
            ->save();

    }
}
